<?php 
/**
 * 
 * 道具 处理类
 * @author tanzhe
 *
 */
class item {
	
	public function get() { //获得商店出售信息
		$url = new Url();
		$shopId = $url->get('shopid');
	  	$key = $url->get('key');
		$itemModel = new ItemModel(); 
		$ret = $itemModel->getItem($key, $shopId);
		
		$callback = $url->get('jsonpcallback');
		Json::do_jsonp_encode($callback,$ret);
	}
	
	public function useItem() { //使用道具
		$url = new Url();
	  	$key = $url->get('key');
		$label = $url->get('label');
		$itemModel = new ItemModel(); 
		$ret = $itemModel->useItem($key, $label);
		
		$callback = $url->get('jsonpcallback');
		Json::do_jsonp_encode($callback,$ret);
	}
	
	public function endBuff() { //查看是否有到期buff
		$url = new Url();
	  	$key = $url->get('key');
		$itemModel = new ItemModel(); 
		$ret = $itemModel->endBuff($key);
		
		$callback = $url->get('jsonpcallback');
		Json::do_jsonp_encode($callback,$ret);
	}	
}
?>